package com.tian.excel.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tian.excel.entity.User;
import com.tian.excel.service.UserService;
import com.tian.excel.mapper.UserMapper;
import com.tian.excel.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Tian
* @description 针对表【sys_user】的数据库操作Service实现
* @createDate 2024-07-29 14:20:32
*/
@Service
public class UserServiceImpl implements UserService{

    @Autowired
    UserMapper userMapper;


    @Override
    @Cacheable(cacheNames = "userInfo")
    public R selectAll() {
        IPage<User> page= new Page<>(1,5);
        List<User> users = userMapper.selectList(page,null);
        page.setRecords(users);
        System.out.println("==========================");
        System.out.println(users);
        System.out.println(page);
        System.out.println("===========================");
        return new R(200,"查询成功",page);
    }
}




